import java.util.Scanner;

public class interviewPhp {

    public static void main(String[] args) throws Exception {

        //初始变量
        int[] infoArray = new int[4];  //该数组是物品信息，其中四个数分别代表：长、宽、高、重量；
        int maxLength ,modLength, minLength, allLength, girth, vWeight, weight;
        double maxLengthIn, modLengthIn, minLengthIn;
        String result = null;

        //输入
        Scanner in = new Scanner(System.in);
        System.out.println("输入数据格式:[xx,xx,xx,xx]，例如: [68, 70, 60, 23]");
        System.out.println("请输入数据：");
        String str = in.nextLine().trim();
        str = str.substring(1,str.length()-1);
        String[] array = str.split(",");
        for(int i = 0; i < 4; i++){
            infoArray[i] = Integer.parseInt(array[i].trim());
        }

        allLength = infoArray[0] + infoArray[1] + infoArray[2];
        maxLength  = infoArray[0];
        minLength  = infoArray[0];
        for(int i = 1; i < 3 ;i++){
            if(maxLength < infoArray[i]){
                maxLength = infoArray[i];
            }
            if(minLength > infoArray[i]){
                minLength = infoArray[i];
            }
        }
        modLength = allLength - maxLength - minLength;

        //对于girth计算的疑点：这里向上取整时机不同结果也会有偏差，这里是采用的运算前向上取整。
        //这里是采用的运算前取整
        maxLengthIn = Math.ceil( maxLength / 2.54d );
        modLengthIn = Math.ceil( modLength / 2.54d );
        minLengthIn = Math.ceil( minLength / 2.54d );
        girth = (int) ( maxLengthIn + 2 * ( modLengthIn + minLengthIn ) );

        //这里是采用的运算后取整
//        girth = (int) Math.ceil( ( maxLength + 2 * ( modLength + minLength ) ) / 2.54d );

        //算体积重时用到的边必须要进行单位转换，不然他和产品重量会差两个数量级，这不太可能的。
        vWeight =(int) Math.ceil( maxLengthIn * modLengthIn * minLengthIn / 250d );
        weight = Math.max( vWeight, (int) Math.ceil( infoArray[3] / 0.454 ) );


        if( weight > 150 || maxLength > 108 || girth > 165){  // out-space
            return;
        }

        if(  (  96 <= maxLength  && maxLength < 108 ) || ( 130 < girth && girth <= 165  ) ){  // oversize
            return;
        }

        if(  50 < weight && weight <= 150 ) result = "[weight";
        if( ( girth > 105 ) || ( 48 <= maxLength && maxLength < 108 ) || ( 30 <= modLength ) ){
            if (result != null && result.length() > 0) result += ", size";
            else result = "[size";
        }
        if(result != null && result.length() > 0) System.out.println(result+"]");

    }

}
